package mvc.controller.app {
	import flash.display.Sprite;

	import mvc.AppNotification;
	import mvc.view.StageMediator;
	import mvc.view.StartupLoadingMediator;
	import mvc.view.components.StageSprite;

	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class AppStartupCommand extends SimpleCommand {
		public function AppStartupCommand() {
			super();
		}

		public override function execute(notification:INotification):void {
			var _stage:Sprite = notification.getBody() as Sprite;
			facade.registerMediator(new StageMediator(new StageSprite(_stage)));
			facade.sendNotification(AppNotification.APP_ADD_VIEW, StartupLoadingMediator.NAME);

			facade.removeCommand(notification.getName());
		}
	}
}
